
        /// <summary>
        /// 字符串转正则表达式
        /// </summary>
        /// <param name="msk">规则字符串</param>
        /// <param name="token">*字符</param>
        /// <returns></returns>
        public static string MaskToRegex(string msk, string token)
        {
            string pattern = string.Empty;
            if (string.IsNullOrEmpty(msk) || string.IsNullOrEmpty(token))
                return string.Empty;
            if (msk.Contains(token))
            {
                MatchCollection mac = Regex.Matches(msk, string.Format(@"\b(\w+)|([{0}]+)|\b|\+", token));
                string regex = string.Empty;
                foreach (Match x in mac)
                {
                    if (!string.IsNullOrEmpty(x.Value))
                    {
                        if (Regex.IsMatch(x.Value, @"\+"))
                        {
                            regex += string.Format(@"\{0}", x.Value); 
                        }
                        else if (Regex.IsMatch(x.Value, string.Format(@"[{0}]+", token)))
                        {
                            string tempmsk = string.Format(@"\w{0}", "{" + x.Value.Length + "}");
                            regex += tempmsk;
                        }
                    }
                }
                pattern = string.Format("^{0}$", regex);
            }
            else
            {
                pattern = msk;
            }
            return pattern;
        }



	public bool DoCheck(string rule, string inputSN)
	{
		string regexRule = RegexRegular.MaskToRegex(rule, "*");
		return Regex.IsMatch(inputSN, regexRule, RegexOptions.None);
	}